<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>BiwaScheme</title>
    <link href="/website/css/screen.css" rel="stylesheet" type="text/css">
    <link href="/website/css/jquery.terminal-2.3.0.css" rel="stylesheet" type="text/css"></script>
    <link href="/website/css/prism-coy.css" rel="stylesheet" type="text/css"></script>
    <script src="/release/biwascheme-@VERSION@-min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.mousewheel.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.timers.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.cookie.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal-2.3.0.js" type="text/javascript"></script>
    <script src="/website/js/prism.js" type="text/javascript"></script>
    <script src="/website/js/prism-scheme.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal.prism.js" type="text/javascript"></script>
    <script src="/website/js/keyboard.js" type="text/javascript"></script>
    <script src="/website/js/biwascheme_terminal.js" type="text/javascript"></script>
  </head>
  <body>
    <a href="https://github.com/biwascheme/biwascheme"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>

    <div id="menu">
      <a href="/index.html">
        <img src="/website/images/biwascheme_logo.png" alt="logo"
             title="BiwaScheme logo by @jcubic">
      </a>
      <ul>
        <li><a href='/doc/features.html'>Features</a></li>
        <li><a href='/doc/getting_started.html'>Getting Started</a></li>
        <li><a href='/doc/reference.html'>Reference</a></li>
        <li><a href='/doc/faq.html'>FAQ</a></li>
        <li><a href='/doc/index.html'>Other docs</a></li>
      </ul>
    </div>
    <div id="content">
<h2 id="features">Features</h2>
<ul>
<li>Most of basic features of R7RS</li>
<li>Some of R6RS Standard Libraries and SRFIs
(see <a href="/doc/conformance.html">doc/conformance</a> )</li>
<li>First-class continuation (<code>call/cc</code>)</li>
</ul>
<p>See <a href="/doc/reference.html">doc/reference</a> for full list of functions.</p>
<h3 id="macro">Macro</h3>
<p>BiwaScheme does not have <code>syntax-rules</code> or <code>syntax-case</code>, but has <a href="/doc/reference.html#macro"><code>define-macro</code></a>.</p>
<h3 id="javascript-language-interface">Javascript language interface</h3>
<ul>
<li>JavaScript object<ul>
<li>js-eval js-ref, etc.</li>
</ul>
</li>
<li>Timer<ul>
<li><code>(timer proc sec)</code> = setTimeout, etc.</li>
<li><code>(sleep sec)</code><ul>
<li>Blocking sleep. <code>(sleep 3)</code> will wait 3 seconds and then 
BiwaScheme resumes running the rest of the code. </li>
</ul>
</li>
</ul>
</li>
<li><p>Console</p>
<ul>
<li><code>(console-debug obj1 ...)</code> = console.debug</li>
</ul>
</li>
<li><p>Browser functions</p>
<ul>
<li>DOM manipulation</li>
<li>Events</li>
<li>Ajax</li>
<li>load js-load</li>
</ul>
</li>
</ul>
<p><a href="/doc/reference.html#js-interface">more...</a></p>
<h3 id="synchronous-interface">Synchronous interface</h3>
<p>Some of the BiwaScheme library functions are implemented as synchronous
functions.</p>
<p>For example, <code>(sleep sec)</code> will stop evaluation of Scheme program
for <code>sec</code> seconds, and then the rest of the program will be evaluated.</p>
<pre><code>(alert &quot;Hello&quot;)
(sleep 3)
(alert &quot;World&quot;)  ; Evaluated after 3 seconds
</code></pre><p>Other synchronous functions are listed below.</p>
<ul>
<li><code>(http-request path)</code> =&gt; string</li>
<li><code>(http-post path params)</code> =&gt; string</li>
<li><code>(receive-jsonp url)</code> =&gt; string</li>
<li><code>(load path)</code></li>
<li><code>(js-load js-path check)</code></li>
<li><code>(wait-for selector event)</code></li>
</ul>
<p>You can get rid of JavaScript&#39;s &quot;callback hell&quot; using these APIs.</p>
<pre><code>// JavaScript (nested callback)
$.get(&quot;/a&quot;, function(a){
  $.get(&quot;/b&quot;, function(b){
    $.get(&quot;/c&quot;, function(c){
      ...
    }
  }
}

// BiwaScheme
(define a (http-request &quot;/a&quot;))
(define b (http-request &quot;/b&quot;))
(define c (http-request &quot;/c&quot;))
...
</code></pre><h3 id="srfis">SRFIs</h3>
<p>BiwaScheme implements some SRFIs (<a href="http://srfi.schemers.org/">Scheme Requests for Implementation</a>).</p>
<ul>
<li>1 List Utilities <ul>
<li>partially - <code>iota</code></li>
</ul>
</li>
<li>6 string port</li>
<li>8 receive</li>
<li>19 time <ul>
<li>partially</li>
</ul>
</li>
<li>27 random <ul>
<li>partially - <code>random-integer</code>, <code>random-real</code></li>
</ul>
</li>
<li>28 simple <code>format</code></li>
<li>30 multi-line comment (<code>#| ... |#</code>)</li>
<li>38 write/ss <ul>
<li>partially - <code>write/ss</code></li>
</ul>
</li>
<li>43 vector <ul>
<li>partially - <code>vector-append</code></li>
</ul>
</li>
<li>62 s-expr comment (<code>#;</code>)</li>
<li>98 get-environment-variable(s) <ul>
<li>Node.js only</li>
</ul>
</li>
</ul>
<h3 id="node-js-support">Node.js support</h3>
<p>You can use BiwaScheme on the server-side with <code>npm install biwascheme</code>
(<a href="/doc/getting_started.html#nodejs">more...</a>)</p>
    </div>

    <!-- Google Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-2023947-5', 'auto');
      ga('send', 'pageview');
    </script>
  </body>
</html>
